using UnityEngine;

public class TutorialCheckpoint : MonoBehaviour
{
	public bool isActive;

	public bool needEventExit;

	public bool triggerCar;

	private void OnTriggerEnter(Collider other)
	{
		if (!isActive && (other.tag == "Player" || (triggerCar && other.GetComponentInParent<EntityBehavior>() != null)))
		{
			isActive = true;
			OtklCheckPoint();
		}
	}

	private void OnTriggerExit(Collider other)
	{
		if (needEventExit && isActive && (other.tag == "Player" || (triggerCar && other.GetComponentInParent<EntityBehavior>() != null)))
		{
			isActive = false;
			VklCheckPoint();
		}
	}

	public void VklCheckPoint()
	{
		for (int i = 0; i < base.transform.childCount; i++)
		{
			base.transform.GetChild(i).gameObject.SetActive(true);
		}
	}

	public void OtklCheckPoint()
	{
		for (int i = 0; i < base.transform.childCount; i++)
		{
			base.transform.GetChild(i).gameObject.SetActive(false);
		}
	}
}
